package sy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * SysRoleAccountMapping entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_role_account_mapping", catalog = "ssh")
public class SysRoleAccountMapping implements java.io.Serializable {

	// Fields

	private String id;
	private SysRole sysRole;
	private SysAccount sysAccount;
	private String remarks;

	// Constructors

	/** default constructor */
	public SysRoleAccountMapping() {
	}

	/** full constructor */
	public SysRoleAccountMapping(SysRole sysRole, SysAccount sysAccount,
			String remarks) {
		this.sysRole = sysRole;
		this.sysAccount = sysAccount;
		this.remarks = remarks;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.string")
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 64)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "role")
	public SysRole getSysRole() {
		return this.sysRole;
	}

	public void setSysRole(SysRole sysRole) {
		this.sysRole = sysRole;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "account")
	public SysAccount getSysAccount() {
		return this.sysAccount;
	}

	public void setSysAccount(SysAccount sysAccount) {
		this.sysAccount = sysAccount;
	}

	@Column(name = "remarks")
	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

}